-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
propagate the number of inputs of the subnetwork to the HDA and support publishing HDAs with spare parameters #172
Conversation
I've one question:
I'll assume it's the second one. I thought we already have an issue for it other than the linked issue #99 but I was wrong. |
Yes - that is correct. |
I tested by publishing one version with custom ordered menu and the other with the menu and some float attributes, It seems that the parameter is still not updated as expected. (It could be that I am using 19.5 for test) updated_parameter_not_shown_in_Houdini.mp4 |
This issue is shown in my demo (the second video in the PR description). |
I also did some retest on that, finding it actually loads the updated parameters for even elder version. I think that makes sense if houdini doesn't really have callback to update parameters by version(show or hide the parameters). |
…inputs-on-hda-publish-2
So hear me out. The only reason why we're imprinting these nodes with these attributes is so that we know what source representation they are, etc. Nothing requires us to store it on the nodes as attributes - we just happen to be doing so because other implementations in Houdini did so too. And hence we could rely on the pre-existing "get_containers" logic that just looked for those attributes. However, nothing is keeping us from adding an additional loop there that does something like (psuedocode):
Or if we do want to start from the node get the representation data from the HDA, but from the node - etc. |
…inputs-on-hda-publish-2
Let me add a quick summary. First of all this is the standard Houdini behavior, it is not relevant to our HDA plugins (to create, publish and load HDA product). So, there are couple of things: Parameters UI and spare parametersWhen the HDA is loaded, The Extra parameters folder might change the parameters UI.
Update spare parameters on definition changeThis one is what really bothers me Changing the HDA asset definition either from the definition dropdown menu or from the loader. doesn't update the spare parameters accordingly. The best way to avoid this issue is by adding the parameters using the type properties. Also, keep in mind, that when changing the definition, the Extra folder is not updated accordingly. mentioned here #12 Mixing parameters (type properties) and spare parametersThis one can result in weird lookin parameters UI especially when keep changing the asset definition. |
This is only the case because:
If the attributes were part of the HDA definition (Type Properties of the HDA) then we'd never need to change the attributes at all from the loader - we would just need to switch the HDA version itself. However, I wanted to clarify - what I meant with my earlier post was: "Can't we avoid attributes altogether?" - Like, can't we as part of the HDA defintion itself (not in Type Properties, but in metadata elsewhere) store this representation id, etc. on publish (so it's a static part of the HDA definition itself). That way, loading the HDA - in what form whatsoever, even if loaded e.g. manually without AYON it would still have the imprinted containerisation and could be detected as such? If that's completely impossible, I also want to stress that by no means is it necessary that these attributes are in a folder, and/or are visible. As such, again on publish of the HDA definition, we can add to its type properties (as we "save the definition" and publish it) the relevant metadata we need as hidden parameters (or even one 'blob data' parameter if we prefer that) where we store what we need and later look back for to find the loaded containers. I'm completely confused by this issue described here @MustafaJafar - the parameters should not change, at all. What's up with that 'juggling of parameters'? The HDA definition should just have a set of attributes (Type Attributes) and that's it. And on load/update we preferably do as LITTLE as possible so we can rely as much as possible on Houdini. So, at best, all we need to 'detect' the representation is completely defined in the HDA definition - and not something we containerize on load. |
As far as I know, to add the
Honestly, I can't think of a clean way to do it. Also, for reference, I'm removing the
This is an Edge case, but once someone hits it, it'll be very annoying. This happens automatically by Houdini. If my HDA has parameters and spare parameters. to trigger this effect, you can simply publish HDA with different parameters and use manage to change the version or you can just change it from the asset definition toolbar. |
So technically, this has nothing to do with us - but is an issue(?) on the Houdini side itself. Or is there reason this is happening to us specifically? |
Because we are making it easier to publish HDAs with spare parameters supported, this behavior will show up more often. |
Also for reference, [From Develop Branch] I can publish HDA with parameters (that were add using type properties) and the parameters will exist when loading the HDA! Also, I've found a nasty bug when I accidently named my parameter to one of the names used by During load error happened on Product: "random_SopHDA" Representation: "hda" Version: 2
Error message: The attempted operation failed.
Reserved parameter 'name' already exists
Traceback (most recent call last):
File "E:\Ynput\ayon-core\client\ayon_core\tools\loader\models\actions.py", line 740, in _load_representations_by_loader
load_with_repre_context(
File "E:\Ynput\ayon-core\client\ayon_core\pipeline\load\utils.py", line 325, in load_with_repre_context
return loader.load(repre_context, name, namespace, options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\Ynput\ayon-houdini\client\ayon_houdini\plugins\load\load_hda.py", line 59, in load
lib.imprint(hda_node, data)
File "E:\Ynput\ayon-houdini\client\ayon_houdini\api\lib.py", line 380, in imprint
node.setParmTemplateGroup(parm_group)
File "C:\PROGRA~1/SIDEEF~1/HOUDIN~1.370/houdini/python3.11libs\hou.py", line 17114, in setParmTemplateGroup
return _hou.OpNode_setParmTemplateGroup(self, parm_template_group, rename_conflicting_parms)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
hou.OperationFailed: The attempted operation failed.
Reserved parameter 'name' already exists |
Not sure if it is really Houdini side of thing as we can actually export the parameters when using python shell to do some simple hda export. The best solution is to reach out the Sidefx for support :). |
…inputs-on-hda-publish-2
Tagging @BigRoy @moonyuet @antirotor for visibility. Before this PR, we didn't enable saving spare parameters toggle. So, the issue was avoided. Suggested solutions:
|
…ble it manually in the HDA definition if they want
…ault behavior) + fix having just a HDA selected to make that publishable instead of collapsing it.
In a call with Mustafa we went through the PR and changes - we ended up going down this route:
Also the UX issues in Houdini's UI mustafa showed here we will ignore - since it's just houdini behavior outside of our scope and not an issue from what we are doing at all. @moonyuet could you try again? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me.
Changelog Description
This PR: resolve #99
Note
This PR is inspired by the code changes in #160
Additional Info
This PR exposed an issue where adding a ramp spare parameter breaks collecting instances for the publisher tool.
#173
Demo
2024-11-15.23-13-11.mp4
2024-11-15.23-27-03.mp4
Testing notes: